<template>
	<div class="bg-act-box">
		<el-dialog
		  title="编辑活动密码标题"
		  :visible.sync="dialogVisible"
		  width="30%"
		  :before-close="handleClose">
		  <div class="b-j-box">
				<span class="m-s-txt-lb">标题:</span>
				<el-radio v-model="radio" label="1">默认</el-radio>
				<el-radio v-model="radio" label="2">自定义</el-radio>
		  </div>
		  <div class="b-j-box" v-if="radio == '2'">
		  	<el-input v-model="inputTxt" placeholder="请输入内容"></el-input>
		  </div>
		</el-dialog>
	</div>
</template>

<script>
	export default
	{
		data()
		{
			return{
				dialogVisible:false,
				radio: '1',
				act:"",
				inputTxt:'输入活动密码后进入活动',
				defaultTxt:"输入活动密码后进入活动",
			}
		},
		
		methods:
		{
			showWin(data)
			{
				this.dialogVisible = true;
				this.act = data.act;
				this.inputTxt = data.data.title;
				this.radio = data.data.type;
			},
			
			handleClose()
			{
				this.dialogVisible = false;
				if(this.radio == '1')
				{
					this.inputTxt = this.defaultTxt;
				}
				let data = {};
				data.act = this.act;
				data.data = this.inputTxt;
				this.$emit('updateActivePwTit',data);
			},
			
			
		}
	}
</script>

<style lang="scss" scoped>
	
	.bg-act-box
	{
		::v-deep.el-dialog
		{
			margin-top: 40vh !important;
		}
		
		.b-j-box
		{
			height: 36px;
			display: flex;
			align-items: center;
		}
	}
	
	.m-s-txt-lb
	{
		padding-right: 10px;
	}
	.o-u-box
	{
		padding-left: 90px;
		display:flex;
		align-items: center;
		padding-top: 20px;
		.u-btn
		{
			margin-left: 10px;
			padding: 4px 20px;
			background-color: #3388FF;
			color:#FFF;
			border-radius: 4px;
			cursor: pointer;
		}
	}
	
</style>